package cn.edu.nit.sys.mapper;

import cn.edu.nit.sys.entity.SysInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author xiaobai
 * @Date 2022/8/30 15:30
 * @Version 1.0.0
 */
@Mapper
public interface SysInfoMapper extends BaseMapper<SysInfo> {

    @Select("select total, used, rate, create_time from sys_info where type = 1 " +
            "order by create_time desc limit 0, 10")
    List<SysInfo> getCpuRate();

    @Select("select revc, send, create_time from sys_info where type = 2 order by create_time desc limit 0, 10")
    List<SysInfo> getNet();
}
